//package com.shf.process.controller;
//
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.shf.process.service.ProcessService;
//import com.shf.process.service.ProcessTemplateService;
//import com.shf.common.result.Result;
//import com.shf.model.process.ProcessTemplate;
//import com.shf.vo.process.ApprovalVo;
//import com.shf.vo.process.ProcessFormVo;
//import com.shf.vo.process.ProcessQueryVo;
//import com.shf.vo.process.ProcessVo;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.access.prepost.PreAuthorize;
//import org.springframework.web.bind.annotation.*;
//import com.shf.model.process.Process;
//
//@Api(tags = "审批流管理")
//@RestController
//@RequestMapping(value = "/admin/process")
//@SuppressWarnings({"unchecked", "rawtypes"})
//public class ProcessController {
//    @Autowired
//    private ProcessTemplateService processTemplateService;
////
////    @Autowired
////    private ProcessService processService;
//
//
//    @PreAuthorize("hasAuthority('bnt.process.list')")
//    @ApiOperation(value = "获取分页列表")
//    @GetMapping("{page}/{limit}")
//    public Result index(
//            @ApiParam(name = "page", value = "当前页码", required = true)
//            @PathVariable Long page,
//
//            @ApiParam(name = "limit", value = "每页记录数", required = true)
//            @PathVariable Long limit,
//
//            @ApiParam(name = "processQueryVo", value = "查询对象", required = false)
//            ProcessQueryVo processQueryVo) {
//        Page<ProcessVo> pageParam = new Page<>(page, limit);
//        IPage<ProcessVo> pageModel = processService.selectPage(pageParam, processQueryVo);
//        return Result.ok(pageModel);
//    }
//
//    @ApiOperation(value = "获取审批模板")
//    @GetMapping("getProcessTemplate/{processTemplateId}")
//    public Result get(@PathVariable Long processTemplateId) {
//        ProcessTemplate processTemplate = processTemplateService.getById(processTemplateId);
//        return Result.ok(processTemplate);
//    }
//
//    @ApiOperation(value = "启动流程")
//    @PostMapping("/startUp")
//    public Result start(@RequestBody ProcessFormVo processFormVo) {
//        processService.startUp(processFormVo);
//        return Result.ok();
//    }
//
//    @ApiOperation(value = "待处理")
//    @GetMapping("/findPending/{page}/{limit}")
//    public Result findPending(
//            @ApiParam(name = "page", value = "当前页码", required = true)
//            @PathVariable Long page,
//
//            @ApiParam(name = "limit", value = "每页记录数", required = true)
//            @PathVariable Long limit) {
//        Page<Process> pageParam = new Page<>(page, limit);
//        IPage<ProcessVo> servicePending = processService.findPending(pageParam);
//        return Result.ok(servicePending);
//    }
//
//    @ApiOperation(value = "获取审批详情")
//    @GetMapping("show/{id}")
//    public Result show(@PathVariable Long id) {
//        return Result.ok(processService.show(id));
//    }
//
//    @ApiOperation(value = "审批")
//    @PostMapping("approve")
//    public Result approve(@RequestBody ApprovalVo approvalVo) {
//        processService.approve(approvalVo);
//        return Result.ok();
//    }
//
//    @ApiOperation(value = "已处理")
//    @GetMapping("/findProcessed/{page}/{limit}")
//    public Result findProcessed(
//            @ApiParam(name = "page", value = "当前页码", required = true)
//            @PathVariable Long page,
//            @ApiParam(name = "limit", value = "每页记录数", required = true)
//            @PathVariable Long limit) {
//        Page<Process> pageParam = new Page<>(page, limit);
//        return Result.ok(processService.findProcessed(pageParam));
//    }
//
//    @ApiOperation(value = "已发起")
//    @GetMapping("/findStarted/{page}/{limit}")
//    public Result findStarted(
//            @ApiParam(name = "page", value = "当前页码", required = true)
//            @PathVariable Long page,
//
//            @ApiParam(name = "limit", value = "每页记录数", required = true)
//            @PathVariable Long limit) {
//        Page<ProcessVo> pageParam = new Page<>(page, limit);
//        return Result.ok(processService.findStarted(pageParam));
//    }
//}